package com.java_enum;

import java.util.Scanner;

public class Email {
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        System.out.println("请输入邮箱");
        String email=in.next();
        int a=email.indexOf("@");
        int b=email.indexOf(".");
        if (a!=-1&&b!=-1&&a!=0&&b!=0&&a!=email.length()&&b!=email.length()&&(b-a)>1){
            System.out.println("合法");
        }else{
            System.out.println("不合法");
        }
    }
}
